"""
Calculating_satellite_position main file
Tengfei Bai 
tengfeibai2021@163.com
"""



from file.outfile import outSatPosFile
from file.readfile import read_navFile
from funcs.satellite import calSatPos, calSatPos_Batch, calSatPos_Series
from funcs.time import gpst2Utc, utc2Gpst
from funcs.coordinate import xyz2blh
from funcs.plot import plotSatPos


#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
def main():

    # 输入广播星历文件
    navigationFile='data\BRDC00IGS_R_20213140000_01D_MN.rnx'

    # 读取文件
    navData=read_navFile(navigationFile)

    # 选择单个卫星的星历数据
    PRN='C38'
    satEphData=navData.navigation[navData.navigation['PRN']==PRN]

    # 计算卫星位置(根据观测时间序列)
    posData=calSatPos_Series(satEphData,PRN)

    # 输出文本文件
    outSatPosFile(posData)

    # 绘图(卫星星下点轨迹)
    plotSatPos(posData)

main()





